namespace QMVnSoft.Lists
{
    using QMVnSoft.Controls;
    using QMVnSoft.DAL;
    using System;
    using System.ComponentModel;
    using System.Drawing;

    public class FormDmYtLister : FormListLister
    {
        private IContainer components;

        public FormDmYtLister()
        {
            this.InitializeComponent();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            base.SuspendLayout();
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.ClientSize = new Size(0x31a, 0x214);
            base.LocalFieldCount = 0;
            base.LocalFieldName = "MA_YT";
            base.LocalTableName = "DMYT";
            base.Name = "FormDmYtLister";
            base.OrderFieldNames = "MA_YT";
            this.Text = "Danh mục yếu tố chi phí";
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        public override bool OnAdd()
        {
            base.LocalFormEditor = new FormDmYtEditor();
            return base.OnAdd();
        }

        public override bool OnEdit()
        {
            base.LocalFormEditor = new FormDmYtEditor();
            return base.OnEdit();
        }

        public override void OnFillData()
        {
            object[][] objArray = new object[5][];
            object[] objArray2 = new object[4];
            objArray2[0] = "Ma_Yt";
            objArray2[1] = "Mã yếu tố";
            objArray2[2] = "C";
            objArray[0] = objArray2;
            object[] objArray3 = new object[4];
            objArray3[0] = "Ten_Yt";
            objArray3[1] = "Tên yếu tố";
            objArray3[2] = "C";
            objArray[1] = objArray3;
            object[] objArray4 = new object[4];
            objArray4[0] = "Loai_Yt";
            objArray4[1] = "Loại";
            objArray4[2] = "C";
            objArray[2] = objArray4;
            object[] objArray5 = new object[4];
            objArray5[0] = "Tk_Cp";
            objArray5[1] = "Tài khoản chi phí";
            objArray5[2] = "C";
            objArray[3] = objArray5;
            object[] objArray6 = new object[4];
            objArray6[0] = "Tk_Yt";
            objArray6[1] = "Tài khoản yếu tố";
            objArray6[2] = "C";
            objArray[4] = objArray6;
            base.ColNames = objArray;
            base.OnFillData();
        }

        public override void OnRefresh()
        {
            base.LocalDataSet = new DmYtDataAccess().GetDataSet();
            base.OnRefresh();
        }
    }
}

